Skip to content

Conversation

@SCool62
Copy link
Contributor

@SCool62 SCool62 commented Jan 12, 2026

Still WIP

@SCool62 SCool62 requested a review from spellingcat January 13, 2026 00:14
@SCool62 SCool62 marked this pull request as ready for review January 13, 2026 05:12
@SCool62
Copy link
Contributor Author

SCool62 commented Jan 13, 2026

I'm marking this as ready for review bc i'm not sure how done it needs to be. No mech-specific code in here, but the infrastructure for binding commands to states, and all the transitions are implemented. The button bindings are implemented but are just placeholders.

Copy link
Member

@spellingcat spellingcat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see the new graph i posted on #software in slack which i think simplifies things enough for the alpha

private void addTransitions() {
bindTransition(SuperState.IDLE, SuperState.INTAKE, intakeReq);

bindTransition(SuperState.INTAKE, SuperState.READY, intakeReq.negate().or(isFull));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add path from intake back to idle if it's empty and intake req is not true

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

intake -> ready needs to be when intakereq.negate().and(is not empty)

bindTransition(
SuperState.SCORE_FLOW, SuperState.READY, scoreReq.negate().and(isEmpty.negate()));

bindTransition(SuperState.SCORE_FLOW, SuperState.SCORE, scoreReq.and(continuousReq.negate()));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is not that important but maybe put the bidirectional transitions next to each other


isFull = new Trigger(routing::isFull);

isEmpty = new Trigger(routing::isEmpty);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i might add an isPartial or something like that for when the second beambreak is true but first is not

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've just done !isEmpty but ig i could do this.

Copy link
Member

@spellingcat spellingcat Jan 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

!isEmpty could include full though (although i can't remember off the top of my head if that's ever relevant still)

.and(DriverStation::isTeleop)
.or(Autos.autoFeedReq);

continuousReq =
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yknow, i might actually get rid of continuous req as a separate button and just do like (intake req and score req) in place of continous req

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I felt like this gave more flexability if we want to change the bindings for continuous (like we could just make continuousReq equal to scoreReq && intakeReq, but we could also make it something else

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah that makes sense. cont = score + intake is good for now i think

@SCool62 SCool62 requested a review from spellingcat January 14, 2026 19:55
Copy link
Member

@spellingcat spellingcat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

quite close. btw i'm thinking everyone should merge their subsystems into main when they're done, merge main -> this branch and make it use the actual methods, then merge this but lmk if you have another idea

// No so sure about the end condition here.
bindTransition(SuperState.FEED_FLOW, SuperState.IDLE, flowReq.negate());

// Maybe should be a transition from idle to flow as well? In case robot doesn't already have a fuel
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think you could probably get away with intake -> score and intake -> feed
since if flowreq = intakereq + scorereq, idle -intakereq-> intake -scorereq-> score -flowreq-> score flow, and same for feed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ig


bindCommands(SuperState.INTAKE, intake.intake(), routing.index(), shooter.rest());

bindCommands(SuperState.READY, intake.rest(), routing.index(), shooter.rest()); // Maybe index at slower speed?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as this is kind of dependent on what irl testing tells us about power draw i think this is ok for now, we can always change it later

@SCool62 SCool62 requested a review from spellingcat January 14, 2026 23:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants